#include<string>
#include<cctype>
using namespace std;
class Solution {
public:
    bool isPalindrome(string s) {
        int i=0,j=s.size()-1;
        while(i<j){
            //不是字母跳过
            if(!isalnum(s[i])) {i++;continue;}
            if(!isalnum(s[j])) {j--;continue;}
            //忽略大小写
            if(s[i]!=s[j]&&tolower(s[i])!=tolower(s[j])){
                return false;
            }
            //更新指针
            i++,j--;
        }
        return true;
    }
};